import * as React from 'react';

export const isReadyRef: any = React.createRef();

export const navigationRef: any = React.createRef();

export function navigate(name: string, params?: object) {
  if (isReadyRef.current && navigationRef.current) {
    navigationRef.current.navigate(name, params);
  } else {
  }
}

export function goBack() {
  if (isReadyRef.current && navigationRef.current) {
    navigationRef.current.goBack();
  } else {
  }
}
